﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<MShop.Core.Domain.Trade>>" %>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div id="content" class="ovfl">
        <div id="left" class="side fl">
            <%=Html.Action("menu")%>
        </div>
        <div id="right" class="main fr">
            <div class="main_ct">
              <div class="userMain">
                <ul >
                    <li>
                        <h2 class="title">
                            订单管理
                        </h2>
                    </li>
                    <li>截至 2010年11月04日，您共有 <span class="point"><%=ViewData["success"] %></span> 张订单已经完成交易，累计消费 <span class="price">¥<%=ViewData["totalsum"] %></span> 元。 </li>
                    <li>有 <span class="point"><%=Model.Where(x=>x.TradeStatus==(int)TradeStatus.等待付款).Count() %> </span>张订单还没有支付，马上去看看这些订单 </li>
                </ul>
                <ul  >
                    <li>
                        <h2 class="title">
                            我的订单
                        </h2>
                    </li>
                    <li>
                        <table>
                            <th>
                                订单号
                            </th>
                            <th>
                                订单商品
                            </th>
                            <th>
                                收货人
                            </th> 
                            <th>
                               下单时间
                            </th>
                            <th>
                               订单金额
                            </th>
                            <th>
                                订单状态
                            </th>
                            <th>
                                操作
                            </th>
                            <% foreach (var item in Model)
                               { %>
                            <tr>
                                <td>
                                   <%=Html.ActionLink(item.TradeId, "TradeItem", "Trade", new { tid = item.TradeId, token = item.Token }, new { @target = "_blank" })%>
                                </td>
                                <td align="left" >
                                    <%=item.TradeProductName %>
                                </td>
                                <td>
                                    <%=item.ReceiverName %>
                                </td>
                                <td>
                                    <%=item.Created.ToShortDateString() %><br />
                                    <%=item.Created.ToShortTimeString() %>
                                </td>
                                <td>
                                    <%=item.TotalSum %>
                                </td>
                                 <td>
                                    <%=(TradeStatus)item.TradeStatus %>
                                </td>
                                <td>
                                <%=Html.ActionLink("查看", "TradeItem", "Trade", new { tid = item.TradeId, token = item.Token }, new { @target = "_blank" })%>
                                </td>
                            </tr>
                            <%} %>
                            <tfoot>
                            <tr class="text_right">
                            <td colspan="7">等待付款订单数：<span class="point"><%=Model.Where(x=>x.TradeStatus==(int)TradeStatus.等待付款).Count() %></span>   未完成的订单数：<span class="point"><%=Model.Where(x=>x.TradeStatus==(int)TradeStatus.无效订单).Count() %></span>   已完成的订单数：<span class="point"><%=ViewData["success"] %></span>   已取消订单数：0   订单总数：<span class="point"><%=Model.Count() %></span>  </td>
                            </tr>
                            </tfoot>
                        </table>
                    </li>
                </ul>
            </div>
            </div>
        </div>
    </div>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="cphMeta" runat="server">
    <link type="text/css" rel="stylesheet" href="/css/userCenter.css" />
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="cphFooter" runat="server">
</asp:Content>
